package cn.stylefeng.guns.modular.hx.storage.service;

import cn.stylefeng.guns.base.pojo.page.LayuiPageInfo;
import cn.stylefeng.guns.modular.agv.model.params.AgvStorageTaskDetailParam;
import cn.stylefeng.guns.modular.hx.dps.entity.DpsZcServer;
import cn.stylefeng.guns.modular.hx.order.model.params.HxOrderPutParam;
import cn.stylefeng.guns.modular.hx.order.model.result.HxOrderPutResult;
import cn.stylefeng.guns.modular.hx.storage.entity.HxStorageOut;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStorageOutDetailedParam;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStorageOutParam;
import cn.stylefeng.guns.modular.hx.storage.model.result.*;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStoragePutDetailedParam;
import cn.stylefeng.guns.modular.hx.storage.model.params.HxStoragePutParam;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStorageOutResult;
import cn.stylefeng.guns.modular.hx.storage.model.result.HxStoragePutDetailedResult;
import cn.stylefeng.guns.modular.hx.storage.model.vo.DpsMidOrdersCVo;
import cn.stylefeng.guns.modular.rest.agv.vo.StorageOutCntOby;
import cn.stylefeng.guns.modular.rest.agv.vo.SueTaskIby;
import cn.stylefeng.guns.sys.modular.system.entity.User;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.models.auth.In;

import javax.management.Query;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 拣货单表 服务类
 * </p>
 *
 * @author zhucx
 * @since 2023-09-05
 */
public interface HxStorageOutService extends IService<HxStorageOut> {

    /**
     * 新增
     *
     * @author zhucx
     * @Date 2023-09-05
     */
    void add(HxStorageOutParam param);

    /**
     * 删除
     *
     * @author zhucx
     * @Date 2023-09-05
     */
    void delete(HxStorageOutParam param);

    /**
     * 更新
     *
     * @author zhucx
     * @Date 2023-09-05
     */
    void update(HxStorageOutParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author zhucx
     * @Date 2023-09-05
     */
    HxStorageOutResult findBySpec(HxStorageOutParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author zhucx
     * @Date 2023-09-05
     */
    List<HxStorageOutResult> findListBySpec(HxStorageOutParam param);

	List<HxStorageOutResult> query(HxStorageOutParam param);

	List<HxStorageOutResult> queryByGetUnitId(Long getUnitId);



    /**
     * 查询分页数据，Specification模式
     *
     * @author zhucx
     * @Date 2023-09-05
     */
     LayuiPageInfo findPageBySpec(HxStorageOutParam param,String condition,Long operateId);

	HxStorageOut findByThelastone();
  	
  	boolean saveBatchList(List<HxStorageOutParam> list);

  	/**
  	 * 查询待领取任务
  	 * @param param
  	 * @return
  	 */
  	LayuiPageInfo findAppDailingquPageBySpec(HxStorageOutParam param);
	
	/**
  	 * 查询已领取任务
  	 * @param
  	 * @return
  	 */
	List<HxStorageOutResult> findAppYilingquBySpec(HxStorageOutParam hxStorageOutParam);

	HxStorageOutResult findSumBySpec(HxStorageOutParam hxStorageOutParam);

	HxStorageOutResult lockBySpec(HxStorageOutParam hxStorageOutParam);

	LayuiPageInfo findAppDailingquzhijianPageBySpec(HxStorageOutParam hxStorageOutParam);

	ResponseData completeStorage(HxStorageOutDetailedParam hxStorageOutDetailedParam,User user);


	List<HxStorageOutResult> findAppYilingquzhijianBySpec(HxStorageOutParam hxStorageOutParam);

	/**
	 * 查询打印门店
	 * @param
	 * @return
	 */
	HxStorageOutResult getPrintStorageOut(HxStorageOutParam hxStorageOutParam);

	void updatePrint(HxStorageOutParam param);

    LayuiPageInfo findstorageuser(HxStorageOutParam hxStorageOutParam ,String condition);

	LayuiPageInfo findqualityuser(HxStorageOutParam hxStorageOutParam, String condition);



	Long findByStorageNumber(String storageNumber);

	HxStorageOutResult findReceivingBySpec(HxStorageOutParam hxStorageOutParam);

	Integer getResid (HxStorageOutParam hxStorageOutParam);

	List<HxStorageOutResult> details(HxStorageOutParam hxStorageOutParam);

	HxStorageOutResult findcheckBySpec(HxStorageOutParam hxStorageOutParam1);

	List<GoodNumVo> getGoodNumByHxStorageOut(HxStorageOutParam hxStorageOutParam);

	List<datavProResult> find(datavProResult  datavProResult);

	List<storeProResult> find1(storeProResult  storeProResult);

	List<chukuPositionResult> findchukuposition(chukuPositionResult chukuPositionResult);

	List<HxStorageOutResult> findJjianhuoData(HxStorageOutResult hxStorageOutResult);

	List<HxStorageOutResult> findZhijianData(HxStorageOutResult hxStorageOutResult);

    List<HxStorageOutResult> findDdPretendCarData(HxStorageOutResult hxStorageOutResult);

	List<HxStorageOutResult> findPrePickOrder(List<Long> getUnit_ids);
	List<HxStorageOutResult> findzuoye(HxStorageOutResult hxStorageOutResult);

    List<chukuPositionResult> findjihuoliang(chukuPositionResult chukuPositionResult);

	void updatePrint2(HxStorageOutParam hxStorageOutParam);
	List<HxStorageOutResult> findlistAllBySpec(HxStorageOutParam hxStorageOutParam, String condition, Long operateId);

	List<HxStorageOutResult> findlistAllBySpec2(HxStorageOutParam hxStorageOutParam, String condition, Long operateId);

	HxStorageOutResult count(HxStorageOutParam hxStorageOutParam, String condition, Long operateId);

	HxStorageOutResult count2(HxStorageOutParam hxStorageOutParam, String condition, Long operateId);

	HxStorageOutResult findCountGoodsBySpec(HxStorageOutParam hxStorageOutParam);


	ResponseData agvReceiving(Integer hxStorageOutId, User user);

	ResponseData agvGetPosition(Integer hxStorageOutId);

	ResponseData agvStorageStart(String agvStorageTaskDetailId);

	ResponseData agvStorageFirst(String agvStorageTaskDetailId);

	ResponseData agvStorageNext(AgvStorageTaskDetailParam agvStorageTaskDetailParam, User user);

	ResponseData agvStorageJump(AgvStorageTaskDetailParam agvStorageTaskDetailParam);

	ResponseData agvStorageToWay(String agvStorageTaskId);

	ResponseData agvJhUser(String agvStorageTaskId,String jhUser);

	public ResponseData agvCompleteStorage(HxStorageOutDetailedParam hxStorageOutDetailedParam);

	public ResponseData dpsCompleteStorage(HxStorageOutDetailedParam hxStorageOutDetailedParam) throws Exception;

	LayuiPageInfo findPageBySpec2(HxStorageOutParam param, String condition, Long operateId);

	boolean checkCustomerStorage(String storageNumber);

	void updateSum(String storageNumber);

	ResponseData agvDistribute(HxStorageOutDetailedParam hxStorageOutDetailedParam, String pickupPoint,
			Integer priority,User user);

	ResponseData reviewCompleted(HxStorageOutParam hxStorageOutParam, User user);

	ResponseData btnCompleted(HxStorageOutParam hxStorageOutParam);

	/**
	 * 批量下发AGV拣货任务
	 * @param ids
	 * @return
	 */
	ResponseData btnAgvStorage(Integer[] ids,User user);

	/**
	 * 批量下发DPS拣货任务
	 * @param dpsMidOrdersCAddPList
	 * @param dpsZcServer
	 * @param user
	 * @return
	 * @throws Exception
	 */
	ResponseData btnDpsStorage(List<DpsMidOrdersCVo> dpsMidOrdersCAddPList, DpsZcServer dpsZcServer, Set<Integer> ids, User user) throws Exception;

	void btnDpsStorageCR(DpsZcServer obj) throws Exception;

	ResponseData AGVtaskIssued(Integer[] ids,User user);

	ResponseData btnAgvStorageScan(Integer[] ids,User user);

	ResponseData autoAgvTaskScan(Long warehouseId);

	/**
	 * 下发任务
	 * @param user
	 * @return
	 */
	ResponseData issueTask(SueTaskIby sueTaskIby,User user);

	List<HxStorageOutResult> findAppAgvYilingquBySpec(HxStorageOutParam hxStorageOutParam);

	HxStorageOutResult findAppAgvYilingquBySpecJs(HxStorageOutParam hxStorageOutParam);

	List<StorageOutCntOby> areaStorageOutCntList(HxStorageOutParam hxStorageOutParam);


	List<HxStorageOutResult> expExcel(HxStorageOutParam param,String condition,Long operateId);

}
